//
// Created by HP on 2025/11/5.
//

#ifndef FLIGHTSERVER_MIDDLEWARE_H
#define FLIGHTSERVER_MIDDLEWARE_H
#include "jwt.h"
#include "Server.h"
#include "util.h"
#include <string>

class Middleware {
    JWT jwt;
public:
    static bool requiredAuth(const Request& req) ;

    static bool requiredAdmin(const Request& req);

    static bool requiredMaintenance(const Request& req);

    static bool requiredContent(const Request& req);

    static bool requiredMoney(const Request& req);



    static std::string extractToken(const std::string& token);

    static int GetCurrentUser(const Request& req);
};

#endif //FLIGHTSERVER_MIDDLEWARE_H
